Skip to content

More spaceship patterns#7702

Merged
fitzgen merged 1 commit into
bytecodealliance:mainfrom
scottmcm:more-icmp-isle
Dec 19, 2023
Merged

More spaceship patterns#7702
fitzgen merged 1 commit into
bytecodealliance:mainfrom
scottmcm:more-icmp-isle

Conversation

@scottmcm
Copy link
Copy Markdown
Contributor

This is a continuation of #7636 that added the spaceship patterns.

In particular, I noticed that what Rust currently does in sort_by

https://github.com/rust-lang/rust/blob/bf9229a2e366b4c311f059014a4aa08af16de5d8/library/core/src/slice/mod.rs#L3008

is a simplification pattern that I'd missed, so this adds that, and a couple other related things I saw in the area.

@scottmcm scottmcm requested a review from a team as a code owner December 18, 2023 22:33
@scottmcm scottmcm requested review from fitzgen and removed request for a team December 18, 2023 22:33
(rule (simplify (select ty _ x x)) x)
(rule (simplify (bitselect ty _ x x)) x)

;; Push zeroes to the right -- this makes the select `truthy`, as used elsewhere
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically this truthy part:

(rule (truthy (select _ x (iconst_u _ (u64_nonzero _)) (iconst_u _ 0))) x)

@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language labels Dec 19, 2023
@github-actions
Copy link
Copy Markdown

Subscribe to Label Action

cc @cfallin, @fitzgen

Details This issue or pull request has been labeled: "cranelift", "isle"

Thus the following users have been cc'd because of the following labels:

  • cfallin: isle
  • fitzgen: isle

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

Copy link
Copy Markdown
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fitzgen fitzgen added this pull request to the merge queue Dec 19, 2023
Merged via the queue into bytecodealliance:main with commit f8c9f67 Dec 19, 2023
@scottmcm scottmcm deleted the more-icmp-isle branch December 19, 2023 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants